<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>供应商管理</title>
<script>
	$(function(){
		/*列表初始化*/
		var gridParam = {
			columns : [[ 
				{field: 'unitNo', title: '供应商编码', width: 120}
				,{field: 'name', title: '供应商名称', width: 150}
				,{field: 'unitKind', title: '类型', width: 80,dictionary:{'0':'公司','1':'个人'},formatter: function(value,row,index){
					return value=='0'?'公司':'个人';
				}}
				,{title: '公司简介', field: 'remark', width: 150}
				,{title: '法人代表', field: 'lealPerson', width: 150}
				,{title: '法人身份证', field: 'lealPersonCard', width: 150}
				,{title: '法人身份证截止日期', field: 'lealPersonCardEndDate', width: 150}
				,{title: '经营性质', field: 'businessType', width: 150}
				,{title: '注册资金', field: 'registeredCapital', width: 150}
				,{title: '注册时间', field: 'registeredDate', width: 150}
				,{title: '营业范围', field: 'businessScope', width: 150}
				,{title: '注册地址', field: 'registeredAddr', width: 150}
				,{title: '通讯地址', field: 'linkAddr', width: 150}
				,{title: '企业纳税性质', field: 'taxProperty', width: 150}
				,{title: '三证合一', field: 'threeInOne',dictionary:{'0':'是','1':'否'}, width: 150,formatter: function(value,row,index){
					return value=='0'?'是':'否';
				}}
				,{title: '社会信用代码', field: 'unifiedCreditCode', width: 150}
				,{title: '营业执照注册号', field: 'licenseNumber', width: 150}
				
				,{title: '组织机构代码', field: 'organizationNo', width: 150}
				,{title: '税务登记号', field: 'taxId', width: 150}
				,{title: '开户行', field: 'bank', width: 150}
				,{title: '收款帐号', field: 'accountPayee', width: 150}
				,{title: '收款帐号', field: 'accountPayee', width: 150}
				
				,{field: 'status', title: '备注', width: 140}
				,{field: 'createTime', title: '创建时间', width: 140}
				,{field: 'createrName', title: '创建人', width: 120}
			]],
			singleSelect : true,
			onLoadSuccess: function(){
				p.tooltip([ 'linkAddr', 'businessScope', 'taxProperty','bank' ,'remark' ]);
			}
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend({}, p.dataGridParam, gridParam));

		/*事件响应*/
		$("#toolbar .easyui-linkbutton").on("click", function() {
			var id = $(this).attr("motion_code");
			switch (id) {
				case "01":
				case "03":
					p.gridDelete();
					break;
				case "04":
					p.gridView({title : "供应商查看", width : 600, height : 300 ,autoMax:true});				
					break;
				case "05":
					p.gridQuery();
					break;
				case "06":
					var row = p.getSelection('请先选定一条记录再处理!');
					if(row){
						$.messager.prompt('备注', '请输入备注信息：', function(r){
							if (r){
								var url = '/console/supplier/rewrite/remark';
								$.getJSON(url, {id:row.id, status : r}, function(result){
									p.dataGrid.datagrid('clearSelections');
									if(result.flag){
										p.gridQuery();
										p.tip({msg: '备注成功！'});  
									} 
								});
							}
						});
					}
					break;
				case "07":
					p.down({filename:'供应商单位列表'});
					break;
				default:
					break;
			}
		});
	});
</script>
</head>
<body  class="easyui-layout">
		<!-- 但行高度33px，多行时 33乘以行数  -->
		<div id="querybar" data-options="region:'north',split:false,border:false" style="height:33px;">
			<div class="easyui-panel" data-options="fit:true,border:false">
				<!-- 查询条件表单，根据配置进行替换  -->
				<form id="queryForm">
				 <input type="hidden" name="className" value="com.fs.jzzn.pojo.AssistUnit" />
				 <div style="margin-top:5px;margin-left:10px;float:left;">
				  	<input class="easyui-textbox" name="unitNo" style="width:240px;" data-options="label:'供应商编号:',required:false" />
					<input type="hidden" name="unitNo_searchType" value="like" />
				 </div>
				  <div style="margin-top:5px;margin-left:10px;float:left;">
				  	<input class="easyui-textbox" name="name" style="width:240px;" data-options="label:'供应商:',required:false" />
					<input type="hidden" name="name_searchType" value="like" />
				 </div>
				</form>
			</div>
		</div>  
	
		<!-- 工具栏按钮 -->
		<div id="toolbar" class="easyui-panel" style="padding:3px;"></div>
		
		<!-- 表格 -->
		<div region="center" border="false">
			<table id="dataGrid"></table>
		</div>
		
</body>
</html>